package com.jinke.api.modules.third.shippo.model.dto;

import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.List;

/**
 * @projectName:
 * @title: ShippoCreateDeclarationsDTO
 * @description: 创建报关单请求参数
 * @see:
 * @author: hhp
 * @version: 1.0.0
 * @createTime: 2024/8/28 11:14
 */
@Data
@Accessors(chain = true)
public class ShippoCreateDeclarationsDTO {
    /**
     * 如果eel_pfc AES_ITN货件的
     * AES/ITN 参考，则为必填项。
     */
    @JSONField(name = "aes_itn")
    private String aesItn;
    /**
     * 非必填
     * B13A 选项详情可通过加拿大出口报告系统 （CERS） 提交 B13A 加拿大出口申报单来获取。 有关申报加拿大商业出口的更多信息。 此处提供允许的值
     * 枚举： “FILED_ELECTRONICALLY” “SUMMARY_REPORTING” “NOT_REQUIRED”
     */
    @JSONField(name = "b13a_filing_option")
    private String b13aFilingOption;
    @JSONField(name = "b13a_number")
    private String b13aNumber;
    private String certificate;
    /**
     * 必填
     * 表示certify_signer已如实提供本报关单的全部信息。
     */
    private Boolean certify;
    /**
     * 必填
     * 报关负责人
     * 创建海关申报单并负责所有报关单有效性的人员的姓名
     */
    @JSONField(name = "certify_signer")
    private String certifySigner;
    @JSONField(name = "commercial_invoice")
    private Boolean commercialInvoice;
    @JSONField(name = "contents_explanation")
    private String contentsExplanation;
    private String disclaimer;
    @JSONField(name = "exporter_identification")
    private ExporterIdentification exporterIdentification;
    @JSONField(name = "exporter_reference")
    private String exporterReference;
    @JSONField(name = "importer_reference")
    private String importerReference;
    @JSONField(name = "is_vat_collected")
    private Boolean isVatCollected;
    private String invoice;
    private String license;
    private String metadata;
    private String notes;
    @JSONField(name = "address_importer")
    private AddressImporter addressImporter;
    /**
     * 必填
     * 用途
     *
     * 枚举： "DOCUMENTS" "GIFT" "SAMPLE" "MERCHANDISE" "HUMANITARIAN_DONATION" "RETURN_MERCHANDISE" "OTHER"
     */
    @JSONField(name = "contents_type")
    private String contentsType;
    @JSONField(name = "eel_pfc")
    private String eelPfc;
    private String incoterm;
    /**
     * 必填
     *
     */
    private List<DeclarationItem> items;
    /**
     * 必填
     * 对应 ShippoNonDeliveryOption.RETURN.name()
     * 如果无法运输处理方式："ABANDON" "RETURN"
     */
    @JSONField(name = "non_delivery_option")
    private String nonDeliveryOption;
    private Boolean test;

    @Data
    public static class ExporterIdentification {
        @JSONField(name = "eori_number")
        private String eoriNumber;
        @JSONField(name = "tax_id")
        private TaxId taxId;
    }
    @Data
    public static class TaxId {
        private String number;
        private String type;
    }
    @Data
    public static class AddressImporter {
        private String name;
        private String company;
        private String street1;
        private String street2;
        private String street3;
        @JSONField(name = "street_no")
        private String streetNo;
        private String city;
        private String state;
        private String zip;
        private String country;
        private String phone;
        private String email;
        @JSONField(name = "is_residential")
        private Boolean is_residential;
    }
    @Data
    public static class DeclarationItem {
        /**
         * 必填
         * 商品的文本描述。
         */
        private String description;
        @JSONField(name = "eccn_ear99")
        private String eccnEar99;
        /**
         * 必填
         * 用于重量的单位。
         *
         * 枚举： "g" "kg" "lb" "oz"
         */
        @JSONField(name = "mass_unit")
        private String massUnit;
        private String metadata;
        /**
         * 必填
         * 此商品的总重量，即数量 * 每件商品的重量。
         */
        @JSONField(name = "net_weight")
        private BigDecimal netWeight;
        /**
         * 必填
         * 商品的原产国。示例：或 . 所有接受的值都可以在 ISO 官方网站上找到。US DE
         */
        @JSONField(name = "origin_country")
        private String originCountry;
        /**
         * 必填
         * 此商品在您发送的货件中的数量。必须大于 0
         */
        private BigDecimal quantity;
        @JSONField(name = "sku_code")
        private String skuCode;
        @JSONField(name = "hs_code")
        private String hsCode;
        @JSONField(name = "tariff_number")
        private String tariffNumber;
        /**
         * 必填
         * 此商品的总价值，即数量 * 每件商品的价值。
         */
        @JSONField(name = "value_amount")
        private BigDecimal valueAmount;
        /**
         * 必填
         * 用于value_amount的货币。使用官方 ISO 4217 货币代码，例如 或。USD EUR
         */
        @JSONField(name = "value_currency")
        private String valueCurrency;
    }
}
